/**
 * 1*1=1
 * 2*1=2 2*2=4
 * 3*1=3 3*2=6 3*3=9
 * ...
 * */

function print(n = 9, callback) {
  callback && callback();
  let total = "";
  for (let j = 1; j <= n; j++) {
    for (let i = 1; i <= j; i++) {
      let unit = `${j}*${i}=${j * i} `;
      total = total + unit;
    }
    total = total + "\n";
  }
  console.log(total);
  callback && callback();
}
export default print;
